package com.jt.util;

import com.jt.pojo.User;

/**
 * @Author: Li Yu
 * @Date: 2020/11/20 15:16
 */
public class UserThreadLocal {
    //在同一线程有效
    private static ThreadLocal<User> userThreadLocal=new ThreadLocal<>();
    //存
    public static void set(User user){
        userThreadLocal.set(user);
    }
    //取
    public static User get(){
        return userThreadLocal.get();
    }
    //删除
    public static void remove(){
        userThreadLocal.remove();
    }
}
